﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace WpfControlLibrary
{
    public class MaterialItem
    {
        public MaterialItem(string key, string title, string docType, bool support, string version, string security, string securityStr, int size)
        {
            this.key = key;
            this.title = title;
            this.support = support;
            this.docType = docType;
            this.version = version;
            this.security = security;
            this.securityStr = securityStr;
            this.size = size;
        }
        private string key;
        private string title;
        private string docType;
        private bool support;
        private string version;
        private string security;
        private string securityStr;
        private int size;


        public string Title { get { return title; } set {  title = value; } }

        public string Version
        {
            get { return version; }
        }
        public string SecurityBackgroundColor
        {
            get 
            {
                string color = "";
                switch (this.security)
                {
                    case "Internal_disclosure":
                        color = "#EFF8EC";
                        break;
                    case "External_disclosure":
                        color = "#E6F6FF";
                        break;
                    case "Secret_and_above":
                        color = "#FEF0F0";
                        break;
                    case "confidential":
                        color = "#FEF0F0";
                        break;
                }
                return color;
            }
        }
        public string SecurityForegroundColor
        {
            get 
            {
                string color = "";
                switch (this.security)
                {
                    case "Internal_disclosure":
                        color = "#31D795";
                        break;
                    case "External_disclosure":
                        color = "#0099F2";
                        break;
                    case "Secret_and_above":
                        color = "#FB4242";
                        break;
                    case "confidential":
                        color = "#FB4242";
                        break;
                }
                return color;
            }
        }
        public string SecurityStr
        {
            get { return securityStr; }
        }

        public bool Support
        {
            get { return support; }
            set { support = value; }
        }


        public string IconPath
        {
            get
            {
                return $"icon/{docType}.png";

            }
        }

        public override string ToString()
        {
            return $"key:{key}, titlte:{title}"; 
        }

        public string Size
        {
            get
            {
                return $"{size}M";
            }
        }

    }
}
